import api from "@/api/api";
export default class {
  getArrayByFormat(array, keyCallback, valueCallback) {
    if (array && array.length > 0 && (keyCallback || valueCallback)) {
      return array.map(function (item) {
        if (!item) {
          return item;
        }
        let destItem = {};
        for (let key in item) {
          let value = item[key];
          if (keyCallback) {
            key = keyCallback(key, value);
          }
          if (valueCallback) {
            value = valueCallback(value, key);
          }
          destItem[key] = value;
        }
        return destItem;
      });
    }
    return array;
  }

  getDatePattern(date, fmt) {
    var o = {
      "M+": date.getMonth() + 1,
      "d+": date.getDate(),
      "h+": date.getHours() % 12 == 0 ? 12 : date.getHours() % 12,
      "H+": date.getHours(),
      "m+": date.getMinutes(),
      "s+": date.getSeconds(),
      "q+": Math.floor((date.getMonth() + 3) / 3),
      "S": date.getMilliseconds()
    };
    if (/(y+)/.test(fmt)) {
      fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
    }
    if (/(E+)/.test(fmt)) {
      var week = {
        "0": "日",
        "1": "一",
        "2": "二",
        "3": "三",
        "4": "四",
        "5": "五",
        "6": "六"
      };
      fmt = fmt.replace(RegExp.$1, ((RegExp.$1.length > 1) ? (RegExp.$1.length > 2 ? "/u661f/u671f" : "/u5468") : "") + week[date.getDay() + ""]);
    }
    for (var k in o) {
      if (new RegExp("(" + k + ")").test(fmt)) {
        fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
      }
    }
    return fmt;
  }

  //获取最近几天的时间
  getDateLately(dayCount) {
    let dd = new Date()
    //获取dayCount天后的日期
    //getDate()是返回周几
    dd.setDate(dd.getDate() - dayCount);
    let y = dd.getFullYear();
    //获取当前月份的日期，不足10补0
    let m = (dd.getMonth() + 1) < 10 ? "0" + (dd.getMonth() + 1) : (dd.getMonth() + 1)
    //获取当前几号，不足10补0
    let d = dd.getDate() < 10 ? "0" + dd.getDate() : dd.getDate()
    //最终日期
    let firstDistribution = y + "-" + m + "-" + d;
    //最终周数
    let reserveTimeWeek = new Date(firstDistribution).getDay()
    return firstDistribution;
  }

  // 把文件内容转换成md5
  getFileMd5(files) {
    var file = files;
    return new Promise(function (resolve, reject) {
      var reader = new FileReader(); //创建读取文件的方法
      var blobSlice =
        File.prototype.slice ||
        File.prototype["mozSlice"] ||
        File.prototype["webkitSlice"];
      let SparkMD5 = require("../utils/spark-md5"); // IE浏览器应用
      var spark = new SparkMD5.ArrayBuffer();
      reader.readAsArrayBuffer(blobSlice.call(file));
      reader.onload = function (e) {
        spark.append(e.target.result);
        var tmp_md5 = spark.end();
        if (tmp_md5) {
          resolve(tmp_md5)
        } else {
          reject("数据有误");
        }
      }

    });
  }

  // 把文件内容转换成base64
  getFileBase64(files) {
    var file = files;
    return new Promise(function (resolve, reject) {
      var reader = new FileReader(); // 创建读取文件的方法
      reader.readAsDataURL(file);
      reader.onload = function (e) {
        var tmp_base64 = e.target.result;
        if (tmp_base64) {
          resolve(tmp_base64)
        } else {
          reject("数据有误");
        }
      }
    });
  }

  //由城市名称变为字母拼音
  getCityEnglist(param) {
    if (param == "宝山") {
      param = "罗店"
    } else if (param == "湖里") {
      param = "厦门湖里"
    }
    for (var x in cityChinese) {
      if (param == cityChinese[x]) {
        return cityEnglist[x]
      }
    }
  }

  //由城市字母拼音变为名称
  getCityChinese(param) {
    for (var x = 0; x < cityEnglist.length; x++) {
      if (cityEnglist[x] == param) {
        return cityChinese[x]
      }
    }
  }

  //获取城市列表
  getCityArray() {
    return cityChinese;
  }

  //车场业务类型由数字变为名称
  getParkTypeChinese(param) {
    for (var x = 0; x < parkTypeNum.length; x++) {
      if (parkTypeNum[x] == param) {
        return parkTypeChinese[x]
      }
    }
  }

  //支付类型由数字变为名称
  getPayTypeChinese(param) {
    for (var x = 0; x < payTypeNum.length; x++) {
      if (payTypeNum[x] == param) {
        return payTypeChinese[x]
      }
    }
  }

  //有视频报警编号 获取报警内容 videoWarn
  getWideoWarnNum(num) {
    for (var x in videoWarn) {
      var item = videoWarn[x];
      if (num == item.num) {
        return item.name;
      }
    }
  }

  //获取收益类型map
  getProfitTypeName() {
    return profitTypeName;
  }

  //获取收益类型map
  getActiveTypeName() {
    return activeTypeName;
  }

  //获取车场类型map
  getParkTypeMap() {
    return parkTypeMap;
  }

  //获取支付类型map
  getPayTypeMap() {
    return payTypeMap;
  }

  //获取路内订单状态map
  getOrderStatusMap() {
    return orderStatusMap;
  }

  //获取订单来源map
  getOrderSourceMap() {
    return orderSourceMap;
  }

  //巡检车事件类型
  getEvtTypeMap() {
    return evtTypeMap;
  }

  //巡检车订单类型
  getCheckTypeMap() {
    return checkTypeMap;
  }

  //巡检车订单类型列表
  getCheckTypeArr() {
    return checkTypeArr;
  }

  //巡检托管
  getApplyStatusMap() {
    return applyStatusMap;
  }

  //巡检托管
  getApplyStatusArr() {
    return applyStatusArr;
  }

  //巡检操作类型
  getActionMap() {
    return actionMap;
  }

  //获取车场记录里面的车场支付方式
  getPayModeMap() {
    return payModeMap;
  }

  //车辆类型
  getCarTypeMap() {
    return carTypeMap;
  }

  //车牌颜色
  getCarColorMap() {
    return carColorMap;
  }

  //关键指标数据
  getKeyFlagMap() {
    return keyFlagMap;
  }

  getKeyParamMap() {
    return keyParamMap;
  }

  //基础数据类型
  getBaseFlagMap() {
    return baseFlagMap;
  }

  //收入数据类
  getIncomeFlagMap() {
    return incomeFlagMap;
  }

  //订单数据类
  getOrderFlagMap() {
    return orderFlagMap;
  }

  //线上数据类
  getOnlineFlagMap() {
    return onlineFlagMap;
  }

  //服务质量类
  getServiceFlagMap() {
    return serviceFlagMap;
  }

  //月租卡类型
  getRentTypeMap() {
    return rentTypeMap;
  }

  //月租卡活动性质
  getModeMap() {
    return modeMap;
  }

  //月租卡活动类型
  getActiveTypeMap() {
    return activeTypeMap;
  }

  //计算停车时长
  getTimeLength(startTime, endTime) {
    let t1 = api.getTimeNumber(startTime);
    let t2 = api.getTimeNumber(endTime);
    if (t2 > t1) {
      let t = t2 - t1;
      let hour = Math.floor(t / 3600);
      t = t % 3600;
      let minute = Math.floor(t / 60);
      let second = Math.floor(t % 60);
      let residenceTime = (hour > 9 ? hour : "0" + hour) + "时" + (minute > 9 ? minute : "0" + minute) + "分" + (second > 9 ? second : "0" + second) + "秒";
      return residenceTime;
    }
  }

  //校验日期数据是否合法格式2021-05-03
  checkDateLegal(dTime) {
    let time = "";
    let page = this;
    if (dTime) {
      if (dTime.indexOf("/") != -1) {
        var arr = dTime.split("/");
        var year, month, day;
        if (arr[0].length == 4) {
          year = arr[0];
          if (parseInt(arr[1]) < 10 && arr[1].length == 1) {
            month = "0" + arr[1];
          } else if (arr[1].length == 2 && arr[1] <= 12) {
            month = arr[1];
          } else {
            api.toast("时间格式中月份有误")
            return;
          }
          if (parseInt(arr[2]) < 10 && arr[2].length == 1) {
            day = "0" + arr[2];
          } else if (arr[2].length == 2 && arr[2] <= 31) {
            day = arr[2];
          } else {
            api.toast("时间格式中天数有误")
            return;
          }
          time = year + "-" + month + "-" + day;
        } else {
          year = arr[2];
          if (parseInt(arr[0]) < 10 && arr[0].length == 1) {
            month = "0" + arr[0];
          } else if (arr[0].length == 2 && arr[0] <= 12) {
            month = arr[0];
          } else {
            api.toast("时间格式中月份有误")
            return;
          }
          if (parseInt(arr[1]) < 10 && arr[0].length == 1) {
            day = "0" + arr[1];
          } else if (arr[1].length == 2 && arr[1] <= 31) {
            day = arr[1];
          } else {
            api.toast("时间格式中天数有误")
            return;
          }
          time = "20" + year + "-" + month + "-" + day;
        }
      } else if (
        dTime.indexOf("-") != -1
      ) {
        if (dTime.indexOf("-") != -1) {
          var arr = dTime.split("-");
          var year, month, day;
          year = arr[0];
          if (parseInt(arr[1]) < 10 && arr[1].length == 1) {
            month = "0" + arr[1];
          } else if (arr[1].length == 2 && arr[1] <= 12) {
            month = arr[1];
          } else {
            api.toast("时间格式中月份有误")
            return;
          }
          if (parseInt(arr[2]) < 10 && arr[2].length == 1) {
            day = "0" + arr[2];
          } else if (arr[2].length == 2 && arr[2] <= 31) {
            day = parseInt(arr[2]);
          } else {
            api.toast("时间格式中天数有误")
            return;
          }
          time = year + "-" + month + "-" + day;
        }
      }
    }
    return time;
  }

  //获取近3个月的数据
  getLast3Month() {
    let nowTime = new Date();
    let year = nowTime.getFullYear();
    let month = nowTime.getMonth() + 1; //0-11表示1-12月
    let day = nowTime.getDate();
    let dateObj = {};
    let last = year + '-' + month + '-' + day;
    let start = "";
    var nowMonthDay = new Date(year, month, 0).getDate(); //当前月的总天数
    if (month - 3 <= 0) { //如果是1、2、3月，年数往前推一年
      var last3MonthDay = new Date((year - 1), (12 - (3 - month)), 0).getDate(); //3个月前所在月的总天数
      if (last3MonthDay < day) { //3个月前所在月的总天数小于现在的天日期
        start = (year - 1) + '-' + (12 - (3 - month)) + '-' + last3MonthDay;
      } else {
        start = (year - 1) + '-' + (12 - (3 - month)) + '-' + day;
      }
    } else {
      var last3MonthDay = new Date(year, (month - 3), 0).getDate(); //3个月前所在月的总天数
      if (last3MonthDay < day) { //3个月前所在月的总天数小于现在的天日期
        if (day < nowMonthDay) { //当前天日期小于当前月总天数,2月份比较特殊的月份
          start = year + '-' + (month - 3) + '-' + (last3MonthDay - (nowMonthDay - day));
        } else {
          start = year + '-' + (month - 3) + '-' + last3MonthDay;
        }
      } else {
        start = year + '-' + (month - 3) + '-' + day;
      }
    }
    let startTime = api.getFormatTime(start, "yyyy-MM-dd");
    let endTime = api.getFormatTime(last, "yyyy-MM-dd");
    dateObj = {
      startTime: startTime,
      endTime: endTime
    }
    return dateObj;
  }

  //获取近1个月的数据
  getLastMonth() {
    var now = new Date();
    var year = now.getFullYear();
    var month = now.getMonth() + 1; //0-11表示1-12月
    var day = now.getDate();
    var dateObj = {};
    let last = year + '-' + month + '-' + day;
    let start = "";
    var nowMonthDay = new Date(year, month, 0).getDate(); //当前月的总天数
    if (month - 1 <= 0) { //如果是1月，年数往前推一年<br>　　　　 
      start = (year - 1) + '-' + 12 + '-' + day;
    } else {
      var lastMonthDay = new Date(year, (month - 1), 0).getDate();
      if (lastMonthDay < day) { //1个月前所在月的总天数小于现在的天日期
        if (day < nowMonthDay) { //当前天日期小于当前月总天数
          start = year + '-' + (month - 1) + '-' + (lastMonthDay - (nowMonthDay - day));
        } else {
          start = year + '-' + (month - 1) + '-' + lastMonthDay;
        }
      } else {
        start = year + '-' + (month - 1) + '-' + day;
      }
    }
    let startTime = api.getFormatTime(start, "yyyy-MM-dd");
    let endTime = api.getFormatTime(last, "yyyy-MM-dd");
    dateObj = {
      startTime: startTime,
      endTime: endTime
    }
    return dateObj;
  }

  // 处理时间范围
  str2timeRage(timeRage, startTime, endTime) {
    timeRage[0] = new Date(startTime);
    timeRage[1] = new Date(endTime);
  }

  timeRage2Str(param, timeRage) {
    param.startTime = api.getFormatTime(timeRage[0], "yyyy-MM-dd");
    param.endTime = api.getFormatTime(timeRage[1], "yyyy-MM-dd");
  }
}

const cityChinese = ['测试', '厦门湖里', '永安', '重庆', '建阳', '武平', '德化', '会昌', '永泰', '丰城', '罗店', '南和'];
const cityEnglist = ['default', 'huli', 'yongan', 'chongqing', 'jianyang', 'wuping', 'dehua', 'huichang', 'yongtai', 'fengcheng', 'luodian', 'nanhe'];
//车场业务类型
const parkTypeChinese = ["欠费追缴", "临时停车缴费", "月租缴费", "用户零钱充值", "商店抵用券充值", "停车场收费员上缴现金", "路内停车缴费", "路内欠费收费员追缴", "路内收费员上缴现金", "路内欠费用户补缴", "退款", "路内异常", "路内免费", "路内欠费", "路内优惠", "车场追缴", "停车卡充值", "预约支付", "预约补缴", "取消预约退款", "预约退款", "预约异常退款", "重复支付", "挪车码"];
const parkTypeNum = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24];
//支付方式
const payTypeChinese = ["未命名", "钱包余额支付,停车币抵,优惠券抵", "微信", "支付宝", "银联", "现金", "平台零钱退款", "路内订单异常", "路内订单免费", "路内订单欠费", "路内订单优惠", "预约退款"];
const payTypeNum = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];

const activeTypeName = {
  1: '全城包月',
  2: '多车场包月',
  3: '多路段包月',
  4: '车场、路内混合包月'
}
//收益类型
const profitTypeName = {
  1: '车场临停收入',
  2: '路内临停收入',
  3: '追缴收入',
  4: '月租收入',
  5: '退款金额',
  6: '路内现金上缴',
  7: '其他数据'
};

//车场支付方式
const payTypeMap = {
  0: "未命名",
  1: "钱包余额支付,停车币抵,优惠券抵,停车卡抵",
  2: "微信",
  3: "支付宝",
  4: "银联",
  5: "现金",
  6: "平台零钱退款",
  7: "路内订单异常",
  8: "路内订单免费",
  9: "路内订单欠费",
  10: "路内订单优惠",
  11: "预约退款",
  12: "工商无感支付",
  13: "ETC无感支付",
  14: "银行转款",
};

//车场业务类型
const parkTypeMap = {
  1: "欠费追缴",
  2: "临时停车缴费",
  3: "月租缴费",
  4: "用户零钱充值",
  5: "商店抵用券充值",
  6: "停车场收费员上缴现金",
  7: "路内停车缴费",
  8: "路内欠费收费员追缴",
  9: "路内收费员上缴现金",
  10: "路内欠费用户补缴",
  11: "退款",
  12: "路内异常",
  13: "路内免费",
  14: "路内欠费",
  15: "路内优惠",
  16: "车场追缴",
  17: "停车卡充值",
  18: "预约支付",
  19: "预约补缴",
  20: "取消预约退款",
  21: "预约退款",
  22: "预约异常退款",
  23: "重复支付",
  24: "挪车码",
  25: "路内重复支付",
  26: "路内审核优惠",
  27: "路内追缴优惠",
  28: "预约支付",
  29: "月结车结算",
  30: "月租车退款",
  31: "月结车欠费",
  32: "月结车优惠",
  33: "商家包月",
  36: "银行转款追缴",
  37: "ETC追缴",
  38: "巡查员审核优惠"
};
//车场支付方式
const payModeMap = { //
  0: '未出场',
  1: '线上支付',
  2: '协管代缴',
  3: '协管现金(遥控)',
  4: '协管现金(按钮)',
  5: '免费放行',
  10: '月租车',
  11: '产权车',
  12: "月结",
  100: "欠费",
  254: '异常人工收费',
  255: '异常记录'
};

//路内订单状态
const orderStatusMap = {
  1: '待结算',
  2: '已结算',
  3: '逃欠费',
  6: '免费',
  7: '异常',
  8: '退款',
  9: '月结车'
};

//路内订单来源
const orderSourceMap = {
  1: '收费员手持机录单',
  2: '用户小程序录单',
  3: '收费员确认',
  4: '巡检车录单',
  5: '路牙机录单',
  6: '视频桩录单',
  7: '高位视频录单',
  8: '人工取证录单',
  100: '未知类型'
};

//巡检车事件类型
const evtTypeMap = {
  0: "地磁检测",
  1: "巡检车取证",
  2: "高位视频取证",
  3: "订单操作",
  4: "审核操作",
  5: "人工取证",
  6: "路牙机取证",
  7: "视频桩取证"
};

//巡检订单类型
const checkTypeMap = {
  2: "巡检车取证",
  3: "高位视频取证",
  5: "人工取证",
  6: "路牙机取证",
  7: "视频桩取证"
};

//巡检车操作类型
const actionMap = {
  1: '流程修正',
  2: '流程废弃',
  3: '流程结算',
  4: '线下结单',
  6: '合并废弃',
  7: '合并审核',
  8: '自动清理'
};

const checkTypeArr = [{
    type: 0,
    name: '全部'
  },
  {
    type: 2,
    name: '巡检车取证'
  },
  {
    type: 3,
    name: '高位视频取证'
  },
  {
    type: 5,
    name: '人工取证'
  },
  {
    type: 6,
    name: '路牙机取证'
  },
  {
    type: 7,
    name: '视频桩取证'
  }
]

//巡检托管
const applyStatusMap = {
  0: '无',
  1: '托管',
  2: '审核',
  3: '托管'
}

const applyStatusArr = [{
    type: 0,
    name: '默认'
  },
  {
    type: 1,
    name: '托管'
  },
  {
    type: 2,
    name: '审核'
  }
]


//车辆类型
const carTypeMap = {
  0: '临时车',
  1: '月租车',
  2: '产权车',
  3: '预约车',
  4: '月结车',
  5: '限时免费车',
  6: '轮询免费车',
  7: '商家包月车',
  8: '商家包月车'
};

//车牌颜色
const carColorMap = {
  0: '蓝色',
  1: '蓝色',
  2: '黄色',
  3: '白色',
  4: '黑色',
  5: '绿色'
};


//运营数据处理

//关键指标数据
const keyFlagMap = {
  1: '录单率',
  2: '净欠费率',
  4: '新增车牌绑定率',
  8: '累计车牌绑定率',
  16: '道边车位产值',
  32: '车场车位产值',
  64: '道边车位周转率',
  128: '车场车位周转率'
};

const keyParamMap = {
  "orderRate": '录单率',
  "arrearsRate": '净欠费率',
  "nbindRate": '新增车牌绑定率',
  "bindRate": '累计车牌绑定率',
  "rosideValue": '道边车位产值',
  "parkValue": '车场车位产值',
  "rosideTurn": '道边车位周转率',
  "parkTurn": '车场车位周转率'
};

//基础数据类型
const baseFlagMap = {
  1: '道边车位数',
  2: '车场车位数',
  4: '道边收费岗位数',
  8: '车位管理员总人数',
  16: '全天班人数',
  32: '半天班人数',
  64: '岗位均管车位数',
  128: '人均管理车位数'
};

//收入数据类
const incomeFlagMap = {
  1: '应收金额',
  2: '实收金额',
  4: '道边临停应收',
  8: '道边临停实收',
  16: '车场临停实收',
  32: '月租金额',
  64: '追缴金额',
  128: '道边追缴占比',
  256: '自主补缴占比',
  512: '停车场追缴占比',
  1024: '欠费金额',
  2048: '商家券面值',
  4096: '商家券实际金额',
  8192: '停车卡面值',
  16384: '停车卡实际金额',
  32768: '退款金额',
  65536: '红冲金额',
  131072: '失效金额',
  262144: '重复支付金额'
};

//订单数据类
const orderFlagMap = {
  1: '订单总数',
  2: '道边订单数',
  4: '车场订单数',
  8: '异常订单数',
  16: '车牌录入错误订单占比',
  32: '待创建无车辆停放订单占比',
  64: '待结算未缴费异常订单占比',
  128: '空车位停放订单数占比',
  256: '其他车辆占用订单数占比',
  512: '异常订单占比',
  1024: '有效订单数',
  2048: '有效订单占比',
  4096: '无效订单占比',
  8192: '岗位平均订单数',
  16384: '车位管理员人均订单数',
  32768: '道边车位使用率',
  65536: '车场车位使用率'
};

//线上数据类
const onlineFlagMap = {
  1: '新增用户数',
  2: '新增绑定手机用户数',
  4: '新增绑定车牌用户数',
  8: '用户总数',
  16: '绑定手机用户数',
  32: '绑定车牌用户数'
};

//服务质量类
const serviceFlagMap = {
  1: '小程序投诉量',
  2: '车场400电话投诉量',
  4: '路内400电话投诉量',
  8: '收费员提交延迟结单订单数',
  16: '收费员提交入场时间错误订单数',
  32: '收费员提交车牌输入错误订单数',
  64: '收费员提交地磁跳单订单数',
  128: '收费员提交提前结束订单数',
};

//月租卡类型
const rentTypeMap = {
  0: '全天月租卡',
  1: '小时月租卡',
  2: '日租卡'
};

//月租卡活动性质
const modeMap = {
  1: '自营',
  2: '代运营',
  3: '承包'
};

//月租卡活动类型
const activeTypeMap = {
  1: '全城包月',
  2: '多车场包月',
  3: '多路段包月',
  4: '车场、路内混合包月'
};

//视频告警集合
const videoWarn = [{
    num: "-1",
    name: "全部"
  },
  {
    num: "10000",
    name: "人体感应事件"
  },
  {
    num: "10001",
    name: "紧急遥控按钮事件"
  },
  {
    num: "10002",
    name: "移动侦测告警"
  },
  {
    num: "10003",
    name: "婴儿啼哭告警"
  },
  {
    num: "10004",
    name: "门磁告警"
  },
  {
    num: "10005",
    name: "烟感告警"
  },
  {
    num: "10006",
    name: "可燃气体告警"
  },
  {
    num: "10008",
    name: "水浸告警"
  },
  {
    num: "10009",
    name: "紧急按钮告警"
  },
  {
    num: "10010",
    name: "人体感应告警"
  },
  {
    num: "10011",
    name: "遮挡告警"
  },
  {
    num: "10012",
    name: "视频丢失"
  },
  {
    num: "10013",
    name: "越界侦测"
  },
  {
    num: "10014",
    name: "区域入侵"
  },
  {
    num: "10015",
    name: "人脸检测事件"
  },
  {
    num: "10016",
    name: "智能门铃告警"
  },
  {
    num: "10018",
    name: "幕帘告警"
  },
  {
    num: "10019",
    name: "单体门磁告警"
  },
  {
    num: "10020",
    name: "场景变更侦测"
  },
  {
    num: "10021",
    name: "虚焦侦测"
  },
  {
    num: "10022",
    name: "音频异常侦测"
  },
  {
    num: "10023",
    name: "物品遗留侦测"
  },
  {
    num: "10024",
    name: "物品拿取侦测"
  },
  {
    num: "10025",
    name: "非法停车侦测"
  },
  {
    num: "10026",
    name: "人员聚集侦测"
  },
  {
    num: "10027",
    name: "徘徊检测侦测"
  },
  {
    num: "10028",
    name: "快速移动侦测"
  },
  {
    num: "10029",
    name: "进入区域侦测"
  },
  {
    num: "10030",
    name: "离开区域侦测"
  },
  {
    num: "10031",
    name: "磁干扰告警"
  },
  {
    num: "10032",
    name: "电池电量低告警"
  },
  {
    num: "10033",
    name: "闯入告警"
  },
  {
    num: "10035",
    name: "婴儿大动作告警"
  },
  {
    num: "10036",
    name: "电源切换告警"
  },
  {
    num: "10079",
    name: "智能检测告警"
  },
  {
    num: "10100",
    name: "IO告警"
  },
  {
    num: "10101",
    name: "IO - 1 告警"
  },
  {
    num: "10102",
    name: "IO - 2 告警"
  },
  {
    num: "10103",
    name: "IO - 3 告警"
  },
  {
    num: "10104",
    name: "IO - 4 告警"
  },
  {
    num: "10105",
    name: "IO - 5 告警"
  },
  {
    num: "10106",
    name: "IO - 6 告警"
  },
  {
    num: "10107",
    name: "IO - 7 告警"
  },
  {
    num: "10108",
    name: "IO - 8 告警"
  },
  {
    num: "10109",
    name: "IO - 9 告警"
  },
  {
    num: "10110",
    name: "IO - 10 告警"
  },
  {
    num: "10111",
    name: "IO - 11 告警"
  },
  {
    num: "10112",
    name: "IO - 12 告警"
  },
  {
    num: "10113",
    name: "IO - 13 告警"
  },
  {
    num: "10114",
    name: "IO - 14 告警"
  },
  {
    num: "10115",
    name: "IO - 15 告警"
  },
  {
    num: "10116",
    name: "IO - 16 告警"
  },
  {
    num: "12000",
    name: "移动侦测告警开始"
  },
  {
    num: "12001",
    name: "视频信号丢失"
  },
  {
    num: "12002",
    name: "遮挡告警开始"
  },
  {
    num: "12003",
    name: "即时防区告警"
  },
  {
    num: "12004",
    name: "即时防区恢复"
  },
  {
    num: "12005",
    name: "24 小时有声防区告警"
  },
  {
    num: "12006",
    name: "24 小时有声防区恢复"
  },
  {
    num: "12007",
    name: "延时防区告警"
  },
  {
    num: "12008",
    name: "延时防区恢复"
  },
  {
    num: "12009",
    name: "内部延时防区告警"
  },
  {
    num: "12010",
    name: "内部延时防区恢复"
  },
  {
    num: "12011",
    name: "火警防区告警"
  },
  {
    num: "12012",
    name: "火警防区恢复"
  },
  {
    num: "12013",
    name: "周界防区告警"
  },
  {
    num: "12014",
    name: "周界防区恢复"
  },
  {
    num: "12015",
    name: "24 小时无声防区告警"
  },
  {
    num: "12016",
    name: "24 小时无声防区恢复"
  },
  {
    num: "12017",
    name: "24 小时辅助防区告警"
  },
  {
    num: "12018",
    name: "24 小时辅助防区告警恢复"
  },
  {
    num: "12019",
    name: "24 小时震动防区告警"
  },
  {
    num: "12020",
    name: "24 小时震动防区告警恢复"
  },
  {
    num: "12021",
    name: "防区感应器被拆"
  },
  {
    num: "12022",
    name: "防区感应器被拆恢复"
  },
  {
    num: "12023",
    name: "软防区紧急告警"
  },
  {
    num: "12024",
    name: "软防区火警"
  },
  {
    num: "12025",
    name: "软防区匪警"
  },
  {
    num: "12026",
    name: "挟持报告"
  },
  {
    num: "12027",
    name: "设备防拆"
  },
  {
    num: "12028",
    name: "设备防拆恢复"
  },
  {
    num: "12029",
    name: "交流电掉电"
  },
  {
    num: "12030",
    name: "交流电恢复"
  },
  {
    num: "12031",
    name: "蓄电池电压低"
  },
  {
    num: "12032",
    name: "蓄电池电压正常"
  },
  {
    num: "12033",
    name: "电话线断开"
  },
  {
    num: "12034",
    name: "电话线连接"
  },
  {
    num: "12035",
    name: "扩展总线模块掉线"
  },
  {
    num: "12036",
    name: "扩展总线模块掉线恢复"
  },
  {
    num: "12037",
    name: "键盘掉线"
  },
  {
    num: "12038",
    name: "键盘恢复"
  },
  {
    num: "12039",
    name: "键盘总线上触发器掉线"
  },
  {
    num: "12040",
    name: "键盘总线上触发器恢复"
  },
  {
    num: "12041",
    name: "自动布撤防失败"
  },
  {
    num: "12042",
    name: "自动撤防失败"
  },
  {
    num: "12043",
    name: "无线网络异常"
  },
  {
    num: "12044",
    name: "无线网络恢复正常"
  },
  {
    num: "12045",
    name: "SIM卡异常"
  },
  {
    num: "12046",
    name: "SIM卡恢复正常"
  },
  {
    num: "12047",
    name: "主机复位"
  },
  {
    num: "12048",
    name: "撤防"
  },
  {
    num: "12049",
    name: "布防"
  },
  {
    num: "12050",
    name: "自动撤防"
  },
  {
    num: "12051",
    name: "自动布防"
  },
  {
    num: "12052",
    name: "消警"
  },
  {
    num: "12053",
    name: "即时布防"
  },
  {
    num: "12054",
    name: "钥匙防区撤防"
  },
  {
    num: "12055",
    name: "钥匙防区布防"
  },
  {
    num: "12056",
    name: "留守布防"
  },
  {
    num: "12057",
    name: "强制布防"
  },
  {
    num: "12058",
    name: "旁路"
  },
  {
    num: "12059",
    name: "旁路恢复"
  },
  {
    num: "12060",
    name: "子系统组旁路"
  },
  {
    num: "12061",
    name: "子系统组旁路恢复"
  },
  {
    num: "12062",
    name: "手动测试报告"
  },
  {
    num: "12063",
    name: "定时测试报告"
  },
  {
    num: "12064",
    name: "单防区撤防"
  },
  {
    num: "12065",
    name: "单防区布防"
  },
  {
    num: "12066",
    name: "键盘锁定"
  },
  {
    num: "12067",
    name: "键盘解锁"
  },
  {
    num: "12068",
    name: "打印机掉线"
  },
  {
    num: "12069",
    name: "打印机恢复"
  },
  {
    num: "12070",
    name: "即时撤防"
  },
  {
    num: "12071",
    name: "留守撤防"
  },
  {
    num: "12072",
    name: "定时开启触发器"
  },
  {
    num: "12073",
    name: "定时关闭触发器"
  },
  {
    num: "12074",
    name: "定时开启触发器失败"
  },
  {
    num: "12075",
    name: "定时关闭触发器失败"
  },
  {
    num: "12076",
    name: "进入编程"
  },
  {
    num: "12077",
    name: "退出编程"
  },
  {
    num: "12078",
    name: "键盘总线上GP / K掉线"
  },
  {
    num: "12079",
    name: "键盘总线上GP / K恢复"
  },
  {
    num: "12080",
    name: "键盘总线上MN / K掉线"
  },
  {
    num: "12081",
    name: "键盘总线上MN / K恢复"
  },
  {
    num: "12082",
    name: "IP冲突"
  },
  {
    num: "12083",
    name: "IP正常"
  },
  {
    num: "12084",
    name: "网线断"
  },
  {
    num: "12085",
    name: "网线正常"
  },
  {
    num: "12086",
    name: "移动侦测告警结束"
  },
  {
    num: "12087",
    name: "遮挡告警结束"
  },
  {
    num: "12088",
    name: "视频信号恢复"
  },
  {
    num: "12089",
    name: "输入 / 输出视频制式不匹配"
  },
  {
    num: "12090",
    name: "输入 / 输出视频制式恢复正常"
  },
  {
    num: "12091",
    name: "视频输入异常"
  },
  {
    num: "12092",
    name: "视频输入恢复正常"
  },
  {
    num: "12093",
    name: "硬盘满"
  },
  {
    num: "12094",
    name: "硬盘空闲"
  },
  {
    num: "12095",
    name: "硬盘出错"
  },
  {
    num: "12096",
    name: "硬盘恢复正常"
  },
  {
    num: "12097",
    name: "图片上传失败"
  },
  {
    num: "12098",
    name: "探测器离线"
  },
  {
    num: "12099",
    name: "探测器恢复在线"
  },
  {
    num: "12100",
    name: "探测器电量欠压"
  },
  {
    num: "12101",
    name: "探测器电量恢复正常"
  },
  {
    num: "12102",
    name: "防区添加探测器"
  },
  {
    num: "12103",
    name: "防区删除探测器"
  },
  {
    num: "12104",
    name: "WIFI通信异常"
  },
  {
    num: "12105",
    name: "WIFI通信恢复正常"
  },
  {
    num: "12106",
    name: "RF信号异常"
  },
  {
    num: "12107",
    name: "RF信号恢复正常"
  },
  {
    num: "10037",
    name: "温度过高告警"
  },
  {
    num: "10038",
    name: "温度过低告警"
  },
  {
    num: "10039",
    name: "湿度过高告警"
  },
  {
    num: "10040",
    name: "湿度过低告警"
  },
  {
    num: "12108",
    name: "主机防拆告警"
  },
  {
    num: "12109",
    name: "主机防拆恢复"
  },
  {
    num: "12110",
    name: "读卡器防拆告警"
  },
  {
    num: "12111",
    name: "读卡器防拆恢复"
  },
  {
    num: "12112",
    name: "事件输入告警"
  },
  {
    num: "12113",
    name: "事件输入恢复"
  },
  {
    num: "12114",
    name: "门控安全模块防拆告警"
  },
  {
    num: "12115",
    name: "门控安全模块防拆恢复"
  },
  {
    num: "12116",
    name: "网络断开"
  },
  {
    num: "12117",
    name: "网络恢复"
  },
  {
    num: "12118",
    name: "设备上电启动"
  },
  {
    num: "12119",
    name: "设备掉电关闭"
  },
  {
    num: "12120",
    name: "门异常打开(门磁)"
  },
  {
    num: "40001",
    name: "第三方抓图"
  },
  {
    num: "40002",
    name: "互联互通"
  },
];